function stopAlert() {
	$("#messagefg").css("display", "none");
	$("#alertcontainer").css("display", "none");
}

function userApprove(str, options, callback) {

	if (options=="YN") htmldata = str+"<table>\
                                                <tr>\
                                                   <td width='70%'>\
                                                   </td>\
                                                   <td>\
                                                   <table width='50%'><tr><td><p class='userapprovebuttons'><input type='button' class='button' value='SI' id='YesButton'></td><td><input type='button' class='button' value='NO' id='NoButton'></p></td></tr></table>\
                                                   </td>\
                                                </tr>\
                                            </table>";
	else if (options=="OK") htmldata = str+"<table width='100%'>\
                                                <tr>\
                                                   <td width='70%'>\
                                                   </td>\
                                                   <td>\
                                                   <p class='userapprovebuttons'><input type='button' class='button' value='OK' id='YesButton'></p>\
                                                   </td>\
                                                </tr>\
                                            </table>";

	$("#alertcontainer").css("display", "block");
	$("#messagefg div div").html(htmldata);
	$("#messagefg").css("display", "block");

	$("#YesButton").one("mouseup", function() {
		stopAlert();
		callback(true);
	});

	$("#NoButton").one("mouseup", function() {
		stopAlert();
		callback(false);
	});
}

//